<?php

namespace app\company\validate;

use sword\validate\Validate;

class EmployeeAddValidate extends Validate
{
    protected $lang = 'zh-cn';

    protected $rule = [
        'mobile|手机号'  => 'require|min:3|max:32',
        '' => 'moreRule',
    ];

    /**
     * 其他验证规则
     * @param $value
     * @param $rule
     * @param array $data
     * @return bool|string
     * @api
     */
    protected function moreRule($value, $rule, array $data = []): bool|string
    {
        if(!empty($data['id'])) return "新增数据不可传入ID";

        return true;
    }
}